package com.iplant.aps.service.po.sch;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;
import java.util.Calendar;

public class APSMessage implements Serializable {
    private static final long serialVersionUID = 1L;

    public int ID = 0; // 错误ID

    public int OrderID = 0;

    /**
     * 错误类型 1物料 2 加工能力  3工艺等待  4 工艺延迟  5 工艺不满足
     */
    public int Type = 0; // 错误类型

    public String ProductNo = ""; // 产品规格

    public int LineID = 0; // 产线ID
    public int PartID = 0; // 工序段ID
    public String PartName = "";
    public String MessageText = ""; // 异常描述

    /**
     * 创建时刻
     */
    public Calendar SubmitTime = Calendar.getInstance();
    /**
     * 唯一ID(用于前端显示甘特图)
     */
    public int UniqueID;

    public APSMessage() {
        this.ID = 0;
        this.Type = 0;
        this.ProductNo = "";
        this.LineID = 0;
        this.PartID = 0;
        this.PartName = "";
        this.MessageText = "";

        SubmitTime.set(2000, 1, 1);
    }

    public APSMessage(int wType, int wOrderID, int wLineID, String wProductNo,
                      String wMsg) {
        this.ID = 0;
        this.OrderID = wOrderID;
        this.LineID = wLineID;
        this.ProductNo = wProductNo;
        this.Type = wType;
        this.MessageText = wMsg;

        SubmitTime.set(2000, 1, 1);
    }

    @JsonProperty("ID")
    public int getID() {
        return ID;
    }

    public void setID(int iD) {
        ID = iD;
    }

    @JsonProperty("OrderID")
    public int getOrderID() {
        return OrderID;
    }

    public void setOrderID(int orderID) {
        OrderID = orderID;
    }

    @JsonProperty("Type")
    public int getType() {
        return Type;
    }

    public void setType(int type) {
        Type = type;
    }

    @JsonProperty("ProductNo")
    public String getProductNo() {
        return ProductNo;
    }

    public void setProductNo(String productNo) {
        ProductNo = productNo;
    }

    @JsonProperty("LineID")
    public int getLineID() {
        return LineID;
    }

    public void setLineID(int lineID) {
        LineID = lineID;
    }

    @JsonProperty("PartID")
    public int getPartID() {
        return PartID;
    }

    public void setPartID(int partID) {
        PartID = partID;
    }

    @JsonProperty("PartName")
    public String getPartName() {
        return PartName;
    }

    public void setPartName(String partName) {
        PartName = partName;
    }

    @JsonProperty("ext")
    public String getMessageText() {
        return MessageText;
    }

    public void setMessageText(String messageText) {
        MessageText = messageText;
    }

    @JsonProperty("CreateTime")
    public Calendar getCreateTime() {
        return SubmitTime;
    }

    public void setCreateTime(Calendar createTime) {
        SubmitTime = createTime;
    }
}
